String.prototype.rtrim=function(){ return this.replace(/\s+$/,""); }